package com.ccx.demo.Controller.CrudController;

import com.ccx.demo.Vo.Result;
import com.ccx.demo.Vo.ResultService;
import com.ccx.demo.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DelController {
    @Autowired
    private SysUserService sysUserService;
    @Autowired
    private ResultService resultService;
    @DeleteMapping("/DelById/{id}")
    public Result DelById(@PathVariable("id") Integer id){
        boolean b = sysUserService.DelById(id);
        if (b){
            return resultService.OK(b);
        }else{
            return resultService.FAIL();
        }
    }
}
